<div ng-init="init();" class="kmi-layout-content B0601-content">
    <div class="kmi-header-row">
        <div class="kmi-side-btn left" ng-click="back();">
            <i class="material-icons">&#xE408;</i>
            <div class="kmi-can-click"></div>
        </div>
        <div class="brand-title">
            <div class="custom" ng-if="companyName">
                <div class="title" ng-bind="companyName"></div>
                <img src="" alt="" class="brand">
                <div class="gap"></div>
            </div>
            <div class="digiwin">
                <img src="image/smes_v340/logo_ch.png" alt="">
                <img src="image/smes_v340/logo_en.png" alt="">
            </div>
        </div>
        <div class="header-title" ng-bind="'B0601.title' | translate"></div>
        <div class="header-logo"></div>
    </div>
    <div class="kmi-layout-main-content">
        <div class="kmi-layout-page left" ng-class="{'min':selectPlotItem}">
            <div class="condition-panel">
                <div class="kmi-text-fields">
                    <label class="label" ng-bind="'B0601.wo_no' | translate"></label>
                    <input class="value" ng-model="condition.wo_no"></input>
                </div>
                <div class="kmi-text-fields">
                    <label class="label" ng-bind="'B0601.plot_no' | translate"></label>
                    <input class="value" ng-model="condition.plot_no" ng-keypress="barcode_plot_no($event);"  id="plot_no"></input>
                    <div class="tip qrcode" ng-click="qrcode_plot_no();" style="top: 2px;right: 27px;">
                        <img src="image/icons/QRCode.png">
                    </div>
                </div>
            </div>
            <div class="btn-panel">
                <div class="kmi-button kmi-button-confrim" ng-click="search()" style="width:100px;margin-top:0px;">
                    <label ng-bind="'B0601.btn.search' | translate"></label>
                    <div class="kmi-can-click"></div>
                </div>
            </div>
            <div class="kmi-list column-selector" kmi-scrollbar="980px" column-selector-id="plot_info_detail">
                <div class="kmi-list__header">
                    <div class="kmi-list__column head-controls" style="flex: 1;min-width:170px;">
                        <div class="filter" ng-show="filter['plot_no']">
                            <input ng-model="filterValue.plot_no" style="margin-top: 4px;font-size: 13px;">
                            <i class="material-icons clear" style="position: absolute;top: 2px;right: 0px;"
                            ng-click="filter['plot_no'] = false;filterValue.plot_no=''">clear</i>
                        </div>
                        <div class="order" ng-hide="filter['plot_no']">
                            <i class="material-icons search" style="z-index:1;" ng-click="filter['plot_no'] = true">search</i>
                            <label ng-bind="'B0601.plot_list.column2' | translate"></label>
                        </div>
                    </div>
                    <div class="kmi-list__column" style="flex: 1;" ng-bind="'B0601.plot_list.column3' | translate"></div>
                    <div class="kmi-list__column hide" style="flex: 1;" ng-bind="'B0601.plot_list.column6' | translate"></div>
                    <div class="kmi-list__column hide" style="flex: 1;" ng-bind="'B0601.plot_list.column7' | translate"></div>
                    <div class="kmi-list__column hide" style="flex: 1;" ng-bind="'B0601.plot_list.column8' | translate"></div>
                    <div class="kmi-list__column" style="flex: 0 0 80px;" ng-bind="'B0601.plot_list.column4' | translate"></div>
                    <div class="kmi-list__column" style="flex: 0 0 100px;" ng-bind="'B0601.plot_list.column5' | translate"></div>
                </div>
                <div class="kmi-list__row-content">
                    <div class="kmi-list__row" ng-repeat="item in getPages(plot_info_detail, PageConfig, filterValue) track by $index"
                        ng-class="{'is-select':checkSelect(item)}">
                        <!--
                        <div class="kmi-list__column column-border" style="flex:0 0 24px;" ng-bind="item.status"></div>
                        -->
                        <div class="kmi-list__column column-border" style="flex:1;min-width:170px;" ng-bind="item.plot_no"></div>
                        <div class="kmi-list__column column-border" style="flex:1;" ng-bind="item.op_no"></div>
                        <div class="kmi-list__column column-border" style="flex:1;" ng-bind="item.item_no"></div>
                        <div class="kmi-list__column column-border" style="flex:1;" ng-bind="item.item_name"></div>
                        <div class="kmi-list__column column-border" style="flex:1;" ng-bind="item.item_spec"></div>
                        <div class="kmi-list__column column-border" style="flex:0 0 80px;text-align: right;" ng-bind="item.qty"></div>
                        <div class="kmi-list__column" style="flex:0 0 100px;" ng-bind="item.finish_time | date:'yyyy-MM-dd'"></div>
                        <div class="kmi-can-click" ng-click="showPlotInfo(item);"></div>
                    </div>
                </div>
            </div>
            <div class="page-content">
                <div class="page-icon">
                    <img src="image/icons/dropleft.png"></img>
                    <div class="kmi-can-click"  ng-click="PageConfig.page = (PageConfig.page-1<0?0:PageConfig.page-1);"></div>
                </div>
                <label ng-bind="(PageConfig.page +1)+' / '+PageConfig.total_page"></label>
                <div class="page-icon">
                    <img src="image/icons/dropright.png"></img>
                    <div class="kmi-can-click"  ng-click="PageConfig.page = (PageConfig.page+1>(PageConfig.total_page-1)?(PageConfig.total_page-1):PageConfig.page+1);"></div>
                </div>
            </div>
        </div>
        <div class="kmi-layout-page right" ng-show="selectPlotItem">
            <div class="kmi-text-fields">
                <label class="label" ng-bind="'B0601.plot_no' | translate"></label>
                <label class="value" ng-bind="selectPlotItem.plot_no"></label>
                <label class="label" ng-bind="'B0601.op_no' | translate"></label>
                <input class="value" ng-model="selectPlotItem.op_no"></input>
                <div class="tip search" ng-click="loadOpNoList();">
                    <img src="image/icons/search.png"></img> 
                </div>
            </div>
            <div>
                <div class="kmi-text-fields">
                    <label class="label" ng-bind="'B0601.wo_no' | translate"></label>
                    <label class="value" ng-bind="selectPlotItem.wo_no"></label>
                    <label class="label" ng-bind="'B0601.so_no' | translate"></label>
                    <label class="value" ng-bind="selectPlotItem.so_no"></label>
                </div>
                <div class="kmi-text-fields">
                    <label class="label" ng-bind="'B0601.customer_no ' | translate"></label>
                    <label class="value" ng-bind="selectPlotItem.customer_no "></label>
                    <label class="label" ng-bind="'B0601.report_datetime' | translate"></label>
                    <label class="value" ng-bind="selectPlotItem.report_datetime | date:'yyyy-MM-dd　HH：mm'"></label>
                </div>
                <div class="kmi-text-fields">
                    <label class="label" ng-bind="'B0601.item_no' | translate"></label>
                    <label class="value" ng-bind="selectPlotItem.item_no"></label>
                    <label class="label" ng-bind="'B0601.item_name' | translate"></label>
                    <label class="value" ng-bind="selectPlotItem.item_name"></label>
                </div>
                <div class="kmi-text-fields">
                    <label class="label" ng-bind="'B0601.item_spec' | translate"></label>
                    <label class="value" ng-bind="selectPlotItem.item_spec"></label>
                    <label class="label" ng-bind="'B0601.graph_no' | translate"></label>
                    <label class="value" ng-bind="selectPlotItem.graph_no"></label>
                </div>
            </div>
            <div>
                <div class="kmi-text-fields">
                    <label class="label" ng-bind="'B0601.qty' | translate"></label>
                    <!-- 20220401 modify by chenshibo for#109861: 强伟：无制程报工无小数点 -->
                    <input class="value" mdl-calculater="selectPlotItem.qty" mdl-calculater-decimal="true"></input>
                    <label class="tip" ng-bind="selectPlotItem.disposed_unit"></label>
                    <label class="label" ng-bind="'B0601.defect_qty' | translate"></label>
                    <!-- 20220401 modify by chenshibo for#109861: 强伟：无制程报工无小数点 -->
                    <input class="value" mdl-calculater="selectPlotItem.defect_qty" mdl-calculater-decimal="true"></input>
                    <label class="tip" ng-bind="selectPlotItem.disposed_unit"></label>
                </div>
                <div class="kmi-text-fields">
                    <label class="label" ng-bind="'B0601.complete_datetime' | translate"></label>
                    <input class="value date" style="flex:0 0 108px;" mdl-datepicker="selectPlotItem.c_datetime_object.date"></input>
                    <input class="value time" style= "flex:0 0 84px;border-left: 0px;" mdl-timepicker="selectPlotItem.c_datetime_object.time"></input>
                </div>
                <div class="kmi-text-fields">
                    <label class="label" ng-bind="'B0601.labor_hours' | translate"></label>
                    <input class="value" mdl-calculater="selectPlotItem.labor_hours" mdl-calculater-decimal="true"></input>
                    <label class="tip" ng-bind="'分'"></label>
                    <label class="label" ng-bind="'B0601.machine_hours' | translate"></label>
                    <input class="value" mdl-calculater="selectPlotItem.machine_hours" mdl-calculater-decimal="true"></input>
                    <label class="tip" ng-bind="'分'"></label>
                </div>
            </div>
            <div class="list-panel">
                <div class="kmi-list employee-list none-column-split">
                    <div class="kmi-list__header">
                        <div class="kmi-list__column input" style="flex: 1;">
                            <label class="label" ng-bind="'B0601.employee_no' | translate"></label>
                            <input class="value" ng-model="selectPlotItem.employee_no" id="employee_no" ng-keypress="employee_add($event);"></input>
                            <div class="tip search" ng-click="loadEmployeeList();">
                                <img src="image/icons/search.png"></img> 
                            </div>
                            <button class="mdl-button mdl-js-button mdl-button--icon kmi-button--icon" ng-click="employee_add();">
                              <img src="image/icons/add.png"></img>
                            </button>
                        </div>
                    </div>
                    <div class="kmi-list__row-content">
                        <div class="kmi-list__row" ng-repeat="item in selectPlotItem.labor_hours_detail track by $index">
                            <div class="kmi-list__column column-border" style="flex:1;" ng-bind="item.employee_no"></div>
                            <div class="kmi-list__column" style="flex:1;" ng-bind="item.employee_name"></div>
                            <div class="kmi-list__column" style="flex: 0 0 36px; padding:0;">
                                <button class="mdl-button mdl-button--icon" ng-click="employee_remove();">
                                    <img src="image/icons/delete.png"></img>
                                </button>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="kmi-list machine-list none-column-split">
                    <div class="kmi-list__header">
                        <div class="kmi-list__column input" style="flex: 1;">
                            <label class="label" ng-bind="'B0601.machine_no' | translate"></label>
                            <input class="value" ng-model="selectPlotItem.machine_no"  id="machine_no" ng-keypress="machine_add($event);"></input>
                            <div class="tip search" ng-click="loadMachineList();">
                                <img src="image/icons/search.png"></img> 
                            </div>
                            <button class="mdl-button mdl-js-button mdl-button--icon kmi-button--icon" ng-click="machine_add();">
                              <img src="image/icons/add.png"></img>
                            </button>
                        </div>
                    </div>
                    <div class="kmi-list__row-content">
                        <div class="kmi-list__row" ng-repeat="item in selectPlotItem.machine_hours_detail track by $index">
                            <div class="kmi-list__column column-border" style="flex:1;" ng-bind="item.machine_no"></div>
                            <div class="kmi-list__column" style="flex:1;" ng-bind="item.machine_name"></div>
                            <div class="kmi-list__column" style="flex: 0 0 36px; padding:0;">
                                <button class="mdl-button mdl-button--icon" ng-click="machine_remove($index,item);">
                                    <img src="image/icons/delete.png"></img>
                                </button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="btn-panel">
                <div class="kmi-button kmi-button-confrim" ng-click="confirm()" style="width:100px;">
                    <label ng-bind="'common.btn.confirm' | translate"></label>
                    <div class="kmi-can-click"></div>
                </div>
                <div class="kmi-button kmi-button-cancel" ng-click="cancel()" style="width:100px;">
                    <label ng-bind="'common.btn.cancel' | translate"></label>
                    <div class="kmi-can-click"></div>
                </div>
            </div>
        </div>
    </div>
</div>
